#
#
CDEPEND         = makedepend $(CFLAGS)
#CFLAGS          = -O2 $(INCLUDEDIRS)
CFLAGS          =  $(INCLUDEDIRS)
COBJS           = $(CSRCS:%.c=%.o)
CSRCS           =  	src/elk_str.c \
			src/elk_port.c \
			src/elk_list.c \
			src/elk_timer.c \
			src/elk_debug.c \
			src/elk_udp.c \
			src/elk_random.c 



INCLUDEDIRS     = -I./inc -I./
CC = gcc -g -Wall 
AR = ar
LDFLAGS         = $(LIBS)
#LIBDIRS        = -L../lib 
#LIBS           = $(LIBDIRS) -lpthread
PROJ            = libelkutil
#noinst_LIBRARIES 
 
all: $(PROJ)


cdepend: $(CSRCS)
	$(CDEPEND) $(CSRCS)
 
clean:
	rm -f $(COBJS)
	rm -f *.so *.a
 

$(PROJ): $(COBJS)
	$(AR) cru $@.a $(COBJS)
	$(CC) -shared -o $@.so $(COBJS) $(LDFLAGS)
check: 	
	 $(CC) test/timer_test.c libelkutil.a $(INCLUDEDIRS) -lpthread -o timer_test
	 $(CC) test/util_test.c libelkutil.a $(INCLUDEDIRS) -lpthread -o util_test

